package com.cg.servlet;
import jakarta.servlet.*;
import java.io.IOException;
public class FirstServlet implements Servlet {

    //无参构造函数
    public FirstServlet(){
        System.out.println("Servlet实例化，创建Servlet对象并存储在内存中");
    }

    @Override
    public void init(ServletConfig servletConfig) throws ServletException {
        System.out.println("Servlet初始化，调用init方法");
    }

    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
        System.out.println("Servlet处理请求,执行业务逻辑，执行service方法");
    }

    @Override
    public void destroy() {
        System.out.println("Servlet销毁，执行destroy方法");
    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public String getServletInfo() {
        return null;
    }
}